// 配置路由的地方
import Vue from 'vue';
import VueRouter from 'vue-router';

// 使用插件
Vue.use(VueRouter);
// 引入路由组件
import Home from '@/pages/Home';
import Search from '@/pages/Search';
import Login from '@/pages/Login';
import Register from '@/pages/Register';

// 配置路由
export default new VueRouter({
   // 配置路由地址
   routes: [
      {
         path: "/",
         redirect: "/home" // 默认重定向到 /home
      },
      {
         path: "/home",
         component: Home,
         meta: {showFooter: true}
      },
      {
        path: '/search/:keyword',
        component: Search,
        meta: {showFooter: true},
        name: "search"
     },
     {
        path: '/login',
        component: Login,
        meta: {showFooter: false}
     },
     {
        path: '/register',
        component: Register,
        meta: {showFooter: false}
     }
   ]  
})